home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / CORE.ZIP / DeskLib / !DLUser / h_doc / Import < prev   
Text File  |  1995-09-02  |  2KB  |  79 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Import.h
  12.     Author:  Copyright © 1995 Julian Smith
  13.     Version: 1.00 (17 Jan 1995)
  14.     Purpose: File import handling.
  15. */
  16.  
  17.  
  18. #ifndef __Import_h
  19. #define __Import_h
  20.  
  21. #ifndef __dl_wimp_h
  22. #include "DeskLib:Wimp.h"
  23. #endif
  24.  
  25.  
  26. typedef void (*import_fileimporter)( message_dataload *data, void *reference);
  27. /*
  28. This function-type should load data from the file specified in 'data'.
  29.  
  30. 'reference' is the reference originally passed to
  31. Import_RegisterFileLoader.
  32. */
  33.  
  34. typedef void *import_ramimporter;
  35. /*
  36. This will be changed sometime to be a function-type for importing using
  37. the RAM transfer protocol.
  38. */
  39.  
  40. BOOL    Import_RegisterFileLoader( 
  41.         import_fileimporter    fn, 
  42.         import_ramimporter    ramfn,
  43.         window_handle        window, 
  44.         icon_handle        icon, 
  45.         void            *reference
  46.         );
  47. /*
  48. This registers an internal function (using Event_Claim) which is called
  49. whenver a file is dropped onto window-icon, and does all the
  50. Wimp_SendMessage stuff involved in the wimp file transfer protocol.
  51.  
  52. 'ramfn' is ignored at the moment - use NULL. Eventuall the Import
  53. library will support ram-transfer.
  54.  
  55. You supply a function 'fn' which will be called to do the actual file-loading, 
  56. using the information in the message_dataload structure.
  57. 'fn' will also be given 'reference' as passed in the original call to 
  58. Import_RegisterFileLoader, which can be used to give extra information.
  59.  
  60. NB message_dataload is defined in DeskLib:Wimp.h and has the following
  61. fields:
  62.     window_handle window;
  63.     icon_handle   icon;
  64.     wimp_point    pos;
  65.     int           estsize;
  66.     int           filetype;
  67.     char          filename[212];
  68.     
  69. The window, icon and pos are the mouse info for where the file was dropped.
  70. filetype and filename are as given by whoever is giving us the file.
  71.  
  72. 'fn' should *not* call Wimp_Poll, as it is called in the middle of
  73. the file-transfer protocol.
  74. */
  75.  
  76.  
  77. #endif
  78.  
  79.